package main

import (
    "facecat"
    "io/ioutil"
)

/*
*视图的鼠标按下方法
*view 视图
*mp 坐标
*buttons 按钮 0未按下 1左键 2右键
*clicks 点击次数
*delta 滚轮值
*/
func OnMouseDown(view *facecat.FCView, mp facecat.FCPoint, buttons int, clicks int, delta int){
    if view.ViewType == "chart" {
        if len(view.GetChart().Data) == 0{
            return
        }
        if len(view.GetChart().AddingPlotChart) > 0 {
            facecat.AddPlotDefault(view, true, mp, false, mp)
            view.GetChart().AddingPlotChart = ""
            facecat.InvalidateView(view)
        } else {
            facecat.TouchDownChart(view, true, mp, false, mp)
            facecat.InvalidateView(view)
        }
    }else{
        facecat.OnMouseDownDefault(view, mp, buttons, clicks, delta)
    }
}

/*
* 鼠标点击实现方法
* view: 图层
* firstTouch:是否第一次触摸
* firstPoint:第一次触摸的坐标
* secondTouch:是否第二次触摸
* secondPoint:第二次触摸的坐标
* clicks:点击次数
*/
func OnClick(view *facecat.FCView, firstTouch bool, firstPoint facecat.FCPoint, secondTouch bool, secondPoint facecat.FCPoint, clicks int){
    facecat.OnClickDefault(view, firstTouch, firstPoint, secondTouch, secondPoint, clicks)
    if view.ViewName == "Indicator" {
        if view.Text == "BOLL" || view.Text == "MA" {
            tChart.GetChart().MainIndicator = view.Text;
        } else {
            tChart.GetChart().ShowIndicator = view.Text;
        }
        facecat.CalcChartIndicator(tChart)
        tabView2 := view.GetParent().GetParent().GetParent()
        facecat.SelectTabPage(tabView2, tabView2.GetTabView().TabPages[0])
        facecat.Invalidate(view.GetPaint())
    } else if view.ViewName == "Plot" {
        tChart.GetChart().AddingPlotChart = view.Text;
        tabView3 := view.GetParent().GetParent().GetParent()
        facecat.SelectTabPage(tabView3, tabView3.GetTabView().TabPages[0])
        facecat.Invalidate(view.GetPaint())
    }
}

func getSecurityDatas()([]*facecat.SecurityData){
    var securityDatas []*facecat.SecurityData
    sData1 := new(facecat.SecurityData)
    sData1.Volume = 78469.756458
    sData1.Close = 15684.25
    sData1.High = 15965.01
    sData1.Low = 15272.69
    sData1.Open = 15297.22
    sData1.Date = 1605052800.0
    securityDatas = append(securityDatas, sData1)
    sData2 := new(facecat.SecurityData)
    sData2.Volume = 102196.366592
    sData2.Close = 16291.87
    sData2.High = 16340.71
    sData2.Low = 15440.65
    sData2.Open = 15684.26
    sData2.Date = 1605139200.0
    securityDatas = append(securityDatas, sData2)
    sData3 := new(facecat.SecurityData)
    sData3.Volume = 75691.891014
    sData3.Close = 16320.71
    sData3.High = 16480.01
    sData3.Low = 15952.36
    sData3.Open = 16291.86
    sData3.Date = 1605225600.0
    securityDatas = append(securityDatas, sData3)
    sData4 := new(facecat.SecurityData)
    sData4.Volume = 59116.357179
    sData4.Close = 16070.46
    sData4.High = 16327.0
    sData4.Low = 15670.01
    sData4.Open = 16320.05
    sData4.Date = 1605312000.0
    securityDatas = append(securityDatas, sData4)
    sData5 := new(facecat.SecurityData)
    sData5.Volume = 43596.851513
    sData5.Close = 15957.01
    sData5.High = 16180.01
    sData5.Low = 15774.73
    sData5.Open = 16069.57
    sData5.Date = 1605398400.0
    securityDatas = append(securityDatas, sData5)
    sData6 := new(facecat.SecurityData)
    sData6.Volume = 81300.685924
    sData6.Close = 16713.58
    sData6.High = 16880.01
    sData6.Low = 15864.01
    sData6.Open = 15957.01
    sData6.Date = 1605484800.0
    securityDatas = append(securityDatas, sData6)
    sData7 := new(facecat.SecurityData)
    sData7.Volume = 115192.02613
    sData7.Close = 17659.39
    sData7.High = 17858.83
    sData7.Low = 16538.01
    sData7.Open = 16713.09
    sData7.Date = 1605571200.0
    securityDatas = append(securityDatas, sData7)
    sData8 := new(facecat.SecurityData)
    sData8.Volume = 141984.264415
    sData8.Close = 17776.13
    sData8.High = 18476.94
    sData8.Low = 17222.01
    sData8.Open = 17659.39
    sData8.Date = 1605657600.0
    securityDatas = append(securityDatas, sData8)
    sData9 := new(facecat.SecurityData)
    sData9.Volume = 93009.571008
    sData9.Close = 17802.83
    sData9.High = 18179.81
    sData9.Low = 17335.66
    sData9.Open = 17777.76
    sData9.Date = 1605744000.0
    securityDatas = append(securityDatas, sData9)
    sData10 := new(facecat.SecurityData)
    sData10.Volume = 88423.028489
    sData10.Close = 18655.68
    sData10.High = 18815.23
    sData10.Low = 17740.05
    sData10.Open = 17802.82
    sData10.Date = 1605830400.0
    securityDatas = append(securityDatas, sData10)
    sData11 := new(facecat.SecurityData)
    sData11.Volume = 71308.137138
    sData11.Close = 18703.81
    sData11.High = 18965.91
    sData11.Low = 18308.59
    sData11.Open = 18655.67
    sData11.Date = 1605916800.0
    securityDatas = append(securityDatas, sData11)
    sData12 := new(facecat.SecurityData)
    sData12.Volume = 74492.806006
    sData12.Close = 18414.61
    sData12.High = 18750.01
    sData12.Low = 17699.8
    sData12.Open = 18703.81
    sData12.Date = 1606003200.0
    securityDatas = append(securityDatas, sData12)
    sData13 := new(facecat.SecurityData)
    sData13.Volume = 74179.661546
    sData13.Close = 18368.01
    sData13.High = 18766.01
    sData13.Low = 18000.01
    sData13.Open = 18413.89
    sData13.Date = 1606089600.0
    securityDatas = append(securityDatas, sData13)
    sData14 := new(facecat.SecurityData)
    sData14.Volume = 70126.693681
    sData14.Close = 19160.02
    sData14.High = 19410.0
    sData14.Low = 18207.99
    sData14.Open = 18368.02
    sData14.Date = 1606176000.0
    securityDatas = append(securityDatas, sData14)
    sData15 := new(facecat.SecurityData)
    sData15.Volume = 70760.56353
    sData15.Close = 18719.12
    sData15.High = 19444.01
    sData15.Low = 18570.01
    sData15.Open = 19160.01
    sData15.Date = 1606262400.0
    securityDatas = append(securityDatas, sData15)
    sData16 := new(facecat.SecurityData)
    sData16.Volume = 102420.321403
    sData16.Close = 17149.48
    sData16.High = 18915.04
    sData16.Low = 16188.01
    sData16.Open = 18718.84
    sData16.Date = 1606348800.0
    securityDatas = append(securityDatas, sData16)
    sData17 := new(facecat.SecurityData)
    sData17.Volume = 84036.578341
    sData17.Close = 17139.53
    sData17.High = 17457.63
    sData17.Low = 16438.09
    sData17.Open = 17149.48
    sData17.Date = 1606435200.0
    securityDatas = append(securityDatas, sData17)
    sData18 := new(facecat.SecurityData)
    sData18.Volume = 60835.734083
    sData18.Close = 17719.86
    sData18.High = 17880.5
    sData18.Low = 16865.57
    sData18.Open = 17139.54
    sData18.Date = 1606521600.0
    securityDatas = append(securityDatas, sData18)
    sData19 := new(facecat.SecurityData)
    sData19.Volume = 55329.026303
    sData19.Close = 18185.0
    sData19.High = 18360.06
    sData19.Low = 17517.01
    sData19.Open = 17719.85
    sData19.Date = 1606608000.0
    securityDatas = append(securityDatas, sData19)
    sData20 := new(facecat.SecurityData)
    sData20.Volume = 96227.350495
    sData20.Close = 19695.88
    sData20.High = 19777.04
    sData20.Low = 18185.0
    sData20.Open = 18185.01
    sData20.Date = 1606694400.0
    securityDatas = append(securityDatas, sData20)
    sData21 := new(facecat.SecurityData)
    sData21.Volume = 100331.141203
    sData21.Close = 18764.97
    sData21.High = 19888.01
    sData21.Low = 18350.0
    sData21.Open = 19695.88
    sData21.Date = 1606780800.0
    securityDatas = append(securityDatas, sData21)
    sData22 := new(facecat.SecurityData)
    sData22.Volume = 75848.875728
    sData22.Close = 19204.1
    sData22.High = 19342.01
    sData22.Low = 18330.01
    sData22.Open = 18764.97
    sData22.Date = 1606867200.0
    securityDatas = append(securityDatas, sData22)
    sData23 := new(facecat.SecurityData)
    sData23.Volume = 64987.682732
    sData23.Close = 19421.91
    sData23.High = 19598.01
    sData23.Low = 18867.21
    sData23.Open = 19204.09
    sData23.Date = 1606953600.0
    securityDatas = append(securityDatas, sData23)
    sData24 := new(facecat.SecurityData)
    sData24.Volume = 65481.220724
    sData24.Close = 18650.53
    sData24.High = 19527.01
    sData24.Low = 18565.32
    sData24.Open = 19422.35
    sData24.Date = 1607040000.0
    securityDatas = append(securityDatas, sData24)
    sData25 := new(facecat.SecurityData)
    sData25.Volume = 42922.758573
    sData25.Close = 19147.67
    sData25.High = 19177.01
    sData25.Low = 18500.01
    sData25.Open = 18650.52
    sData25.Date = 1607126400.0
    securityDatas = append(securityDatas, sData25)
    sData26 := new(facecat.SecurityData)
    sData26.Volume = 37043.101861
    sData26.Close = 19359.41
    sData26.High = 19420.01
    sData26.Low = 18857.01
    sData26.Open = 19147.67
    sData26.Date = 1607212800.0
    securityDatas = append(securityDatas, sData26)
    sData27 := new(facecat.SecurityData)
    sData27.Volume = 40833.661907
    sData27.Close = 19166.91
    sData27.High = 19420.92
    sData27.Low = 18902.89
    sData27.Open = 19358.68
    sData27.Date = 1607299200.0
    securityDatas = append(securityDatas, sData27)
    sData28 := new(facecat.SecurityData)
    sData28.Volume = 56080.515386
    sData28.Close = 18324.12
    sData28.High = 19294.85
    sData28.Low = 18200.01
    sData28.Open = 19166.91
    sData28.Date = 1607385600.0
    securityDatas = append(securityDatas, sData28)
    sData29 := new(facecat.SecurityData)
    sData29.Volume = 75498.213856
    sData29.Close = 18541.29
    sData29.High = 18639.58
    sData29.Low = 17650.01
    sData29.Open = 18324.12
    sData29.Date = 1607472000.0
    securityDatas = append(securityDatas, sData29)
    sData30 := new(facecat.SecurityData)
    sData30.Volume = 52890.685094
    sData30.Close = 18254.64
    sData30.High = 18557.33
    sData30.Low = 17911.13
    sData30.Open = 18541.3
    sData30.Date = 1607558400.0
    securityDatas = append(securityDatas, sData30)
    sData31 := new(facecat.SecurityData)
    sData31.Volume = 72610.734259
    sData31.Close = 18036.54
    sData31.High = 18292.74
    sData31.Low = 17572.34
    sData31.Open = 18254.82
    sData31.Date = 1607644800.0
    securityDatas = append(securityDatas, sData31)
    sData32 := new(facecat.SecurityData)
    sData32.Volume = 47592.761572
    sData32.Close = 18808.7
    sData32.High = 18948.67
    sData32.Low = 18020.71
    sData32.Open = 18036.54
    sData32.Date = 1607731200.0
    securityDatas = append(securityDatas, sData32)
    sData33 := new(facecat.SecurityData)
    sData33.Volume = 56560.831744
    sData33.Close = 19175.0
    sData33.High = 19411.01
    sData33.Low = 18711.13
    sData33.Open = 18808.7
    sData33.Date = 1607817600.0
    securityDatas = append(securityDatas, sData33)
    sData34 := new(facecat.SecurityData)
    sData34.Volume = 47257.211294
    sData34.Close = 19273.15
    sData34.High = 19349.01
    sData34.Low = 19000.01
    sData34.Open = 19175.0
    sData34.Date = 1607904000.0
    securityDatas = append(securityDatas, sData34)
    sData35 := new(facecat.SecurityData)
    sData35.Volume = 61792.483421
    sData35.Close = 19426.44
    sData35.High = 19570.01
    sData35.Low = 19050.01
    sData35.Open = 19273.7
    sData35.Date = 1607990400.0
    securityDatas = append(securityDatas, sData35)
    sData36 := new(facecat.SecurityData)
    sData36.Volume = 97061.040854
    sData36.Close = 21335.53
    sData36.High = 21560.01
    sData36.Low = 19278.61
    sData36.Open = 19426.44
    sData36.Date = 1608076800.0
    securityDatas = append(securityDatas, sData36)
    sData37 := new(facecat.SecurityData)
    sData37.Volume = 148769.444419
    sData37.Close = 22808.99
    sData37.High = 23699.71
    sData37.Low = 21233.01
    sData37.Open = 21335.53
    sData37.Date = 1608163200.0
    securityDatas = append(securityDatas, sData37)
    sData38 := new(facecat.SecurityData)
    sData38.Volume = 79646.144315
    sData38.Close = 23107.4
    sData38.High = 23285.19
    sData38.Low = 22350.01
    sData38.Open = 22797.16
    sData38.Date = 1608249600.0
    securityDatas = append(securityDatas, sData38)
    sData39 := new(facecat.SecurityData)
    sData39.Volume = 82430.712232
    sData39.Close = 23821.62
    sData39.High = 24171.48
    sData39.Low = 22750.01
    sData39.Open = 23107.4
    sData39.Date = 1608336000.0
    securityDatas = append(securityDatas, sData39)
    sData40 := new(facecat.SecurityData)
    sData40.Volume = 74797.201958
    sData40.Close = 23455.53
    sData40.High = 24295.01
    sData40.Low = 23060.01
    sData40.Open = 23821.61
    sData40.Date = 1608422400.0
    securityDatas = append(securityDatas, sData40)
    sData41 := new(facecat.SecurityData)
    sData41.Volume = 83424.441428
    sData41.Close = 22719.72
    sData41.High = 24102.78
    sData41.Low = 21815.01
    sData41.Open = 23455.55
    sData41.Date = 1608508800.0
    securityDatas = append(securityDatas, sData41)
    sData42 := new(facecat.SecurityData)
    sData42.Volume = 87033.13616
    sData42.Close = 23810.8
    sData42.High = 23837.11
    sData42.Low = 22353.41
    sData42.Open = 22719.89
    sData42.Date = 1608595200.0
    securityDatas = append(securityDatas, sData42)
    sData43 := new(facecat.SecurityData)
    sData43.Volume = 112830.021287
    sData43.Close = 23232.77
    sData43.High = 24100.01
    sData43.Low = 22810.01
    sData43.Open = 23810.8
    sData43.Date = 1608681600.0
    securityDatas = append(securityDatas, sData43)
    sData44 := new(facecat.SecurityData)
    sData44.Volume = 69013.844252
    sData44.Close = 23729.21
    sData44.High = 23794.44
    sData44.Low = 22703.43
    sData44.Open = 23232.4
    sData44.Date = 1608768000.0
    securityDatas = append(securityDatas, sData44)
    sData45 := new(facecat.SecurityData)
    sData45.Volume = 78024.251646
    sData45.Close = 24712.48
    sData45.High = 24789.87
    sData45.Low = 23434.74
    sData45.Open = 23729.0
    sData45.Date = 1608854400.0
    securityDatas = append(securityDatas, sData45)
    sData46 := new(facecat.SecurityData)
    sData46.Volume = 97806.523386
    sData46.Close = 26493.4
    sData46.High = 26867.04
    sData46.Low = 24500.01
    sData46.Open = 24712.48
    sData46.Date = 1608940800.0
    securityDatas = append(securityDatas, sData46)
    sData47 := new(facecat.SecurityData)
    sData47.Volume = 145880.8092
    sData47.Close = 26281.67
    sData47.High = 28422.01
    sData47.Low = 25700.01
    sData47.Open = 26493.41
    sData47.Date = 1609027200.0
    securityDatas = append(securityDatas, sData47)
    sData48 := new(facecat.SecurityData)
    sData48.Volume = 79408.740817
    sData48.Close = 27079.42
    sData48.High = 27500.01
    sData48.Low = 26101.01
    sData48.Open = 26281.55
    sData48.Date = 1609113600.0
    securityDatas = append(securityDatas, sData48)
    sData49 := new(facecat.SecurityData)
    sData49.Volume = 69255.341092
    sData49.Close = 27385.01
    sData49.High = 27410.01
    sData49.Low = 25880.01
    sData49.Open = 27079.43
    sData49.Date = 1609200000.0
    securityDatas = append(securityDatas, sData49)
    sData50 := new(facecat.SecurityData)
    sData50.Volume = 95356.067826
    sData50.Close = 28875.55
    sData50.High = 28996.01
    sData50.Low = 27320.01
    sData50.Open = 27385.01
    sData50.Date = 1609286400.0
    securityDatas = append(securityDatas, sData50)
    sData51 := new(facecat.SecurityData)
    sData51.Volume = 75491.419522
    sData51.Close = 28923.64
    sData51.High = 29300.01
    sData51.Low = 27850.01
    sData51.Open = 28875.56
    sData51.Date = 1609372800.0
    securityDatas = append(securityDatas, sData51)
    sData52 := new(facecat.SecurityData)
    sData52.Volume = 54134.113624
    sData52.Close = 29331.7
    sData52.High = 29600.01
    sData52.Low = 28624.58
    sData52.Open = 28923.64
    sData52.Date = 1609459200.0
    securityDatas = append(securityDatas, sData52)
    sData53 := new(facecat.SecurityData)
    sData53.Volume = 126100.088124
    sData53.Close = 32178.34
    sData53.High = 33300.01
    sData53.Low = 28946.54
    sData53.Open = 29331.71
    sData53.Date = 1609545600.0
    securityDatas = append(securityDatas, sData53)
    sData54 := new(facecat.SecurityData)
    sData54.Volume = 110771.806254
    sData54.Close = 33000.06
    sData54.High = 34778.12
    sData54.Low = 31963.0
    sData54.Open = 32176.46
    sData54.Date = 1609632000.0
    securityDatas = append(securityDatas, sData54)
    sData55 := new(facecat.SecurityData)
    sData55.Volume = 121030.155465
    sData55.Close = 31988.72
    sData55.High = 33600.01
    sData55.Low = 28130.01
    sData55.Open = 33000.06
    sData55.Date = 1609718400.0
    securityDatas = append(securityDatas, sData55)
    sData56 := new(facecat.SecurityData)
    sData56.Volume = 111890.475678
    sData56.Close = 33949.54
    sData56.High = 34360.01
    sData56.Low = 29900.01
    sData56.Open = 31989.76
    sData56.Date = 1609804800.0
    securityDatas = append(securityDatas, sData56)
    sData57 := new(facecat.SecurityData)
    sData57.Volume = 116093.037717
    sData57.Close = 36769.37
    sData57.High = 36939.22
    sData57.Low = 33288.01
    sData57.Open = 33949.54
    sData57.Date = 1609891200.0
    securityDatas = append(securityDatas, sData57)
    sData58 := new(facecat.SecurityData)
    sData58.Volume = 121506.449096
    sData58.Close = 39432.29
    sData58.High = 40365.01
    sData58.Low = 36300.01
    sData58.Open = 36769.37
    sData58.Date = 1609977600.0
    securityDatas = append(securityDatas, sData58)
    sData59 := new(facecat.SecurityData)
    sData59.Volume = 138625.042444
    sData59.Close = 40582.82
    sData59.High = 41950.01
    sData59.Low = 36500.01
    sData59.Open = 39432.49
    sData59.Date = 1610064000.0
    securityDatas = append(securityDatas, sData59)
    sData60 := new(facecat.SecurityData)
    sData60.Volume = 75785.989675
    sData60.Close = 40088.23
    sData60.High = 41380.01
    sData60.Low = 38720.01
    sData60.Open = 40586.97
    sData60.Date = 1610150400.0
    securityDatas = append(securityDatas, sData60)
    sData61 := new(facecat.SecurityData)
    sData61.Volume = 112638.990321
    sData61.Close = 38150.03
    sData61.High = 41350.01
    sData61.Low = 35111.12
    sData61.Open = 40088.23
    sData61.Date = 1610236800.0
    securityDatas = append(securityDatas, sData61)
    sData62 := new(facecat.SecurityData)
    sData62.Volume = 231175.583454
    sData62.Close = 35404.48
    sData62.High = 38264.75
    sData62.Low = 30420.01
    sData62.Open = 38150.03
    sData62.Date = 1610323200.0
    securityDatas = append(securityDatas, sData62)
    sData63 := new(facecat.SecurityData)
    sData63.Volume = 133948.161996
    sData63.Close = 34051.25
    sData63.High = 36628.01
    sData63.Low = 32531.01
    sData63.Open = 35410.38
    sData63.Date = 1610409600.0
    securityDatas = append(securityDatas, sData63)
    sData64 := new(facecat.SecurityData)
    sData64.Volume = 124477.924938
    sData64.Close = 37371.39
    sData64.High = 37850.01
    sData64.Low = 32380.01
    sData64.Open = 34049.16
    sData64.Date = 1610496000.0
    securityDatas = append(securityDatas, sData64)
    sData65 := new(facecat.SecurityData)
    sData65.Volume = 102950.399421
    sData65.Close = 39144.51
    sData65.High = 40100.01
    sData65.Low = 36701.24
    sData65.Open = 37371.39
    sData65.Date = 1610582400.0
    securityDatas = append(securityDatas, sData65)
    sData66 := new(facecat.SecurityData)
    sData66.Volume = 111365.804668
    sData66.Close = 36742.23
    sData66.High = 39747.77
    sData66.Low = 34538.89
    sData66.Open = 39145.22
    sData66.Date = 1610668800.0
    securityDatas = append(securityDatas, sData66)
    sData67 := new(facecat.SecurityData)
    sData67.Volume = 86348.441508
    sData67.Close = 35994.99
    sData67.High = 37950.01
    sData67.Low = 35357.81
    sData67.Open = 36737.44
    sData67.Date = 1610755200.0
    securityDatas = append(securityDatas, sData67)
    sData68 := new(facecat.SecurityData)
    sData68.Volume = 80157.737384
    sData68.Close = 35828.62
    sData68.High = 36852.51
    sData68.Low = 33850.01
    sData68.Open = 35994.99
    sData68.Date = 1610841600.0
    securityDatas = append(securityDatas, sData68)
    sData69 := new(facecat.SecurityData)
    sData69.Volume = 70693.90404
    sData69.Close = 36631.28
    sData69.High = 37469.84
    sData69.Low = 34800.01
    sData69.Open = 35825.0
    sData69.Date = 1610928000.0
    securityDatas = append(securityDatas, sData69)
    sData70 := new(facecat.SecurityData)
    sData70.Volume = 79596.541309
    sData70.Close = 35891.5
    sData70.High = 37850.01
    sData70.Low = 35844.07
    sData70.Open = 36622.47
    sData70.Date = 1611014400.0
    securityDatas = append(securityDatas, sData70)
    sData71 := new(facecat.SecurityData)
    sData71.Volume = 89368.432918
    sData71.Close = 35468.24
    sData71.High = 36415.32
    sData71.Low = 33400.01
    sData71.Open = 35901.95
    sData71.Date = 1611100800.0
    securityDatas = append(securityDatas, sData71)
    sData72 := new(facecat.SecurityData)
    sData72.Volume = 134548.811336
    sData72.Close = 30850.14
    sData72.High = 35600.01
    sData72.Low = 30071.01
    sData72.Open = 35468.24
    sData72.Date = 1611187200.0
    securityDatas = append(securityDatas, sData72)
    sData73 := new(facecat.SecurityData)
    sData73.Volume = 138345.853436
    sData73.Close = 32945.18
    sData73.High = 33826.54
    sData73.Low = 28850.01
    sData73.Open = 30852.0
    sData73.Date = 1611273600.0
    securityDatas = append(securityDatas, sData73)
    sData74 := new(facecat.SecurityData)
    sData74.Volume = 64595.297675
    sData74.Close = 32078.01
    sData74.High = 33456.01
    sData74.Low = 31390.17
    sData74.Open = 32950.01
    sData74.Date = 1611360000.0
    securityDatas = append(securityDatas, sData74)
    sData75 := new(facecat.SecurityData)
    sData75.Volume = 57978.047966
    sData75.Close = 32259.91
    sData75.High = 33071.01
    sData75.Low = 30900.01
    sData75.Open = 32078.01
    sData75.Date = 1611446400.0
    securityDatas = append(securityDatas, sData75)
    sData76 := new(facecat.SecurityData)
    sData76.Volume = 88499.236921
    sData76.Close = 32254.21
    sData76.High = 34875.01
    sData76.Low = 31910.01
    sData76.Open = 32259.46
    sData76.Date = 1611532800.0
    securityDatas = append(securityDatas, sData76)
    sData77 := new(facecat.SecurityData)
    sData77.Volume = 84866.207055
    sData77.Close = 32467.78
    sData77.High = 32921.89
    sData77.Low = 30837.38
    sData77.Open = 32254.2
    sData77.Date = 1611619200.0
    securityDatas = append(securityDatas, sData77)
    sData78 := new(facecat.SecurityData)
    sData78.Volume = 95911.971711
    sData78.Close = 30366.16
    sData78.High = 32557.3
    sData78.Low = 29241.73
    sData78.Open = 32464.02
    sData78.Date = 1611705600.0
    securityDatas = append(securityDatas, sData78)
    sData79 := new(facecat.SecurityData)
    sData79.Volume = 92621.155617
    sData79.Close = 33364.87
    sData79.High = 33783.99
    sData79.Low = 29842.11
    sData79.Open = 30362.2
    sData79.Date = 1611792000.0
    securityDatas = append(securityDatas, sData79)
    sData80 := new(facecat.SecurityData)
    sData80.Volume = 193388.622446
    sData80.Close = 34252.21
    sData80.High = 38531.91
    sData80.Low = 31915.41
    sData80.Open = 33368.19
    sData80.Date = 1611878400.0
    securityDatas = append(securityDatas, sData80)
    sData81 := new(facecat.SecurityData)
    sData81.Volume = 82674.758249
    sData81.Close = 34262.89
    sData81.High = 34933.01
    sData81.Low = 32825.01
    sData81.Open = 34246.29
    sData81.Date = 1611964800.0
    securityDatas = append(securityDatas, sData81)
    sData82 := new(facecat.SecurityData)
    sData82.Volume = 66269.928016
    sData82.Close = 33092.99
    sData82.High = 34342.7
    sData82.Low = 32171.68
    sData82.Open = 34262.9
    sData82.Date = 1612051200.0
    securityDatas = append(securityDatas, sData82)
    sData83 := new(facecat.SecurityData)
    sData83.Volume = 80154.567802
    sData83.Close = 33526.38
    sData83.High = 34717.28
    sData83.Low = 32296.17
    sData83.Open = 33089.45
    sData83.Date = 1612137600.0
    securityDatas = append(securityDatas, sData83)
    sData84 := new(facecat.SecurityData)
    sData84.Volume = 78056.66988
    sData84.Close = 35466.25
    sData84.High = 35984.34
    sData84.Low = 33418.01
    sData84.Open = 33517.1
    sData84.Date = 1612224000.0
    securityDatas = append(securityDatas, sData84)
    sData85 := new(facecat.SecurityData)
    sData85.Volume = 80784.343663
    sData85.Close = 37618.88
    sData85.High = 37662.64
    sData85.Low = 35362.39
    sData85.Open = 35472.72
    sData85.Date = 1612310400.0
    securityDatas = append(securityDatas, sData85)
    sData86 := new(facecat.SecurityData)
    sData86.Volume = 89024.320756
    sData86.Close = 36936.67
    sData86.High = 38708.28
    sData86.Low = 36161.96
    sData86.Open = 37620.27
    sData86.Date = 1612396800.0
    securityDatas = append(securityDatas, sData86)
    sData87 := new(facecat.SecurityData)
    sData87.Volume = 65910.531514
    sData87.Close = 38290.25
    sData87.High = 38310.13
    sData87.Low = 36570.01
    sData87.Open = 36936.66
    sData87.Date = 1612483200.0
    securityDatas = append(securityDatas, sData87)
    sData88 := new(facecat.SecurityData)
    sData88.Volume = 94232.612846
    sData88.Close = 39186.95
    sData88.High = 40955.52
    sData88.Low = 38215.95
    sData88.Open = 38289.33
    sData88.Date = 1612569600.0
    securityDatas = append(securityDatas, sData88)
    sData89 := new(facecat.SecurityData)
    sData89.Volume = 81820.439177
    sData89.Close = 38795.7
    sData89.High = 39700.01
    sData89.Low = 37351.01
    sData89.Open = 39181.02
    sData89.Date = 1612656000.0
    securityDatas = append(securityDatas, sData89)
    sData90 := new(facecat.SecurityData)
    sData90.Volume = 121568.794672
    sData90.Close = 46374.88
    sData90.High = 46794.46
    sData90.Low = 37988.9
    sData90.Open = 38795.7
    sData90.Date = 1612742400.0
    securityDatas = append(securityDatas, sData90)
    sData91 := new(facecat.SecurityData)
    sData91.Volume = 114567.009318
    sData91.Close = 46420.43
    sData91.High = 48142.2
    sData91.Low = 44961.1
    sData91.Open = 46374.87
    sData91.Date = 1612828800.0
    securityDatas = append(securityDatas, sData91)
    sData92 := new(facecat.SecurityData)
    sData92.Volume = 78292.89657
    sData92.Close = 44807.59
    sData92.High = 47310.01
    sData92.Low = 43800.01
    sData92.Open = 46420.43
    sData92.Date = 1612915200.0
    securityDatas = append(securityDatas, sData92)
    sData93 := new(facecat.SecurityData)
    sData93.Volume = 81033.184776
    sData93.Close = 47969.52
    sData93.High = 48678.91
    sData93.Low = 43994.03
    sData93.Open = 44807.59
    sData93.Date = 1613001600.0
    securityDatas = append(securityDatas, sData93)
    sData94 := new(facecat.SecurityData)
    sData94.Volume = 81856.490636
    sData94.Close = 47287.61
    sData94.High = 48985.81
    sData94.Low = 46400.01
    sData94.Open = 47968.67
    sData94.Date = 1613088000.0
    securityDatas = append(securityDatas, sData94)
    sData95 := new(facecat.SecurityData)
    sData95.Volume = 58937.84066
    sData95.Close = 47153.7
    sData95.High = 48150.01
    sData95.Low = 46202.54
    sData95.Open = 47298.16
    sData95.Date = 1613174400.0
    securityDatas = append(securityDatas, sData95)
    sData96 := new(facecat.SecurityData)
    sData96.Volume = 70700.864117
    sData96.Close = 48577.8
    sData96.High = 49707.44
    sData96.Low = 47014.18
    sData96.Open = 47156.79
    sData96.Date = 1613260800.0
    securityDatas = append(securityDatas, sData96)
    sData97 := new(facecat.SecurityData)
    sData97.Volume = 63227.659425
    sData97.Close = 47911.11
    sData97.High = 49010.93
    sData97.Low = 46174.79
    sData97.Open = 48580.48
    sData97.Date = 1613347200.0
    securityDatas = append(securityDatas, sData97)
    sData98 := new(facecat.SecurityData)
    sData98.Volume = 78018.176005
    sData98.Close = 49133.46
    sData98.High = 50080.22
    sData98.Low = 47003.63
    sData98.Open = 47911.11
    sData98.Date = 1613433600.0
    securityDatas = append(securityDatas, sData98)
    sData99 := new(facecat.SecurityData)
    sData99.Volume = 84886.224046
    sData99.Close = 52119.72
    sData99.High = 52618.75
    sData99.Low = 48947.01
    sData99.Open = 49133.46
    sData99.Date = 1613520000.0
    securityDatas = append(securityDatas, sData99)
    sData100 := new(facecat.SecurityData)
    sData100.Volume = 58093.930825
    sData100.Close = 51552.61
    sData100.High = 52530.01
    sData100.Low = 50901.91
    sData100.Open = 52117.68
    sData100.Date = 1613606400.0
    securityDatas = append(securityDatas, sData100)
    return securityDatas
}

var gPaint = facecat.CreatePaint()
var tChart = new(facecat.FCView)

func WndProc(hwnd facecat.HWND, msg uint32, wParam, lParam uintptr) (result uintptr) {
    return facecat.WndProcDefault(gPaint, hwnd, msg, wParam, lParam)
}

func main() {
    gPaint.OnMouseDown = OnMouseDown
    gPaint.OnClick = OnClick
    facecat.CreateMainWindow(gPaint, "FaceCat-Go", WndProc)
    xmlStr, _ := ioutil.ReadFile("xml//chartexample.xml")
    facecat.RenderFaceCat(gPaint, string(xmlStr))
    chart := facecat.FindViewByName("Chart", gPaint.Views)
    inChart := chart.GetChart()
    chart.BackColor = "rgb(255,255,255)"
    chart.BorderColor = "rgb(150,150,150)"
    chart.TextColor = "rgb(0,0,0)"
    inChart.ScaleColor = "rgb(0,0,0)"
    inChart.CrossTipColor = "rgb(220,220,220)"
    inChart.CrossLineColor = "rgb(100,100,100)"
    inChart.GridColor = "rgb(125,125,125)"
    tChart = chart
    tabPage2 := facecat.FindViewByName("TabPage2", gPaint.Views)
    tabPage3 := facecat.FindViewByName("TabPage3", gPaint.Views)
    inChart.RightVScaleWidth = 60
    chart.Location = facecat.CreatePoint(0, 0)
    inChart.Data = getSecurityDatas()
    inChart.MainIndicator = "BOLL" //主图指标
    inChart.ShowIndicator = "MACD" //显示指标
    facecat.ResetChartVisibleRecord(chart)
    facecat.CheckChartLastVisibleIndex(chart)
    facecat.CalcChartIndicator(chart)
    indLayout := facecat.CreateView("layout")
    indLayout.Dock = "fill"
    indLayout.Location = facecat.CreatePoint(0, 0)
    indLayout.Size = facecat.CreateSize(tabPage2.Size.Cx, tabPage2.Size.Cy)
    indLayout.GetLayoutDiv().AutoWrap = true
    facecat.AddViewToParent(indLayout, tabPage2)
    var indicators []string
    indicators = append(indicators, "MA")
    indicators = append(indicators, "BOLL")
    indicators = append(indicators, "MACD")
    indicators = append(indicators, "KDJ")
    indicators = append(indicators, "BIAS")
    indicators = append(indicators, "BBI")
    indicators = append(indicators, "RSI")
    indicators = append(indicators, "ROC")
    indicators = append(indicators, "WR")
    indicators = append(indicators, "DMA")
    indicators = append(indicators, "TRIX")
    indicators = append(indicators, "CCI")
    for i := 0; i < len(indicators); i++{
        button := facecat.CreateView("button")
        button.Text = indicators[i]
        button.ViewName = "Indicator"
        button.Size = facecat.CreateSize(100, 50)
        button.Margin = facecat.CreatePadding(10, 10, 10, 10)
        facecat.AddViewToParent(button, indLayout)
    }    

    indLayout2 := facecat.CreateView("layout")
    indLayout2.Dock = "fill"
    indLayout2.Location = facecat.CreatePoint(0, 0)
    indLayout2.Size = facecat.CreateSize(tabPage3.Size.Cx, tabPage3.Size.Cy)
    indLayout2.GetLayoutDiv().AutoWrap = true
    facecat.AddViewToParent(indLayout2, tabPage3)

    var plots []string
    plots = append(plots, "Line")
    plots = append(plots, "Segment")
    plots = append(plots, "Ray")
    plots = append(plots, "Triangle")
    plots = append(plots, "Rect")
    plots = append(plots, "Cycle")
    plots = append(plots, "CircumCycle")
    plots = append(plots, "Ellipse")
    plots = append(plots, "AngleLine")
    plots = append(plots, "LRLine")
    plots = append(plots, "LRChannel")
    plots = append(plots, "SymmetricTriangle")
    plots = append(plots, "LRBand")
    plots = append(plots, "ParalleGram")
    plots = append(plots, "SpeedResist")
    plots = append(plots, "FiboFanline")
    plots = append(plots, "FiboTimezone")
    plots = append(plots, "Percent")
    plots = append(plots, "BoxLine")
    plots = append(plots, "TironeLevels")
    plots = append(plots, "QuadrantLines")
    plots = append(plots, "Parallel")
    plots = append(plots, "GoldenRatio")
    plots = append(plots, "ArrowSegment")
    for i:= 0; i < len(plots); i++{
        button := facecat.CreateView("button")
        button.Text = plots[i]
        button.ViewName = "Plot"
        button.Size = facecat.CreateSize(100, 50)
        button.Margin = facecat.CreatePadding(10, 10, 10, 10)
        facecat.AddViewToParent(button, indLayout2)
    }
    facecat.UpdateViewDefault(gPaint.Views)
    facecat.Invalidate(gPaint)
    facecat.ShowWindow(gPaint)
}